package com.example.administrator.ygddriver.into.login.driverjoin.weight;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.administrator.ygddriver.R;
import com.example.administrator.ygddriver.base.BaseActivity;
import com.example.administrator.ygddriver.into.login.driverjoin.weight.weightmessage.WeightMessageActivity;
import com.example.administrator.ygddriver.tool.SimpleToolbar;

public class WeightActivity extends BaseActivity implements View.OnClickListener {
    private SimpleToolbar simpleToolbar;
    private ImageView imageView;
    private String url;
    private TextView mNextTv;
    private String c_drivertype;

    @Override
    public int initLayout() {
        return R.layout.activity_weight;
    }

    @Override
    public void initView() {
        simpleToolbar = findViewById(R.id.activity_weight_stb);
        imageView = findViewById(R.id.activity_weight_iv);
        mNextTv = findViewById(R.id.activity_weight_next_tv);
        mNextTv.setOnClickListener(this);
    }

    @Override
    public void initDate() {
        url = getIntent().getStringExtra("c_url");
        c_drivertype = getIntent().getStringExtra("c_drivertype");
        Glide.with(this).load(url).into(imageView);
        setSimpleToolbar();
    }

    private void setSimpleToolbar() {
        simpleToolbar.setMainTitle("车主注册");
        simpleToolbar.setMainTitleColor("#000000");
        simpleToolbar.setBackIv(R.mipmap.left_title);
        simpleToolbar.setToolColor("#ffffff");
        simpleToolbar.setBackIvClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.activity_weight_next_tv:
                Intent intent = new Intent(this, WeightMessageActivity.class);
                intent.putExtra("c_drivertype", c_drivertype);
                startActivity(intent);
                finish();
                break;
        }
    }
}
